#!/bin/bash

timesLeft=3
interval=4
rootPWD='root'

while getopts "t:i:p:" opt; do
  case $opt in
    t)
      echo "this is -t the arg is ! $OPTARG" 
      timesLeft=$OPTARG
      ;;
    i)
      echo "this is -i the arg is ! $OPTARG" 
      interval=$OPTARG
      ;;
    p)
      echo "this is -p the arg is ! $OPTARG" 
      rootPWD=$OPTARG
      ;;

    \?)
      echo "Invalid option: -$OPTARG" 
      ;;
  esac
done

echo $timesLeft
echo $interval
echo $rootPWD

./opts001.sh -i 87 -t 53
#./reboot_pwd  -p rootroot01 -i 3  -t 2
./reboot_pwd.sh  rootroot01 3  2

